package com.then.component.club.ui;

import android.databinding.ObservableList;

import com.then.architecture.ActionViewListener;
import com.then.architecture.VOCreator;
import com.then.architecture.view.StickyListGroup;
import com.then.architecture.vo.RecyclerVo;
import com.then.component.club.BR;
import com.then.component.club.R;
import com.then.component.club.databinding.ActivityClubListBinding;
import com.then.component.club.ui.base.ClubModuleDelegate;

/**
 * Created by 42524 on 2018/1/27.
 */

public class ClubListDelegate extends ClubModuleDelegate<ClubListVo, ActivityClubListBinding> {

    RecyclerVo recyclerVo;

    @Override
    public int getRootLayoutId() {
        return R.layout.activity_club_list;
    }

    @Override
    protected VOCreator createVo() {
        return new VOCreator(ClubListVo.class, BR.vo);
    }

    protected void initClubList(ObservableList clubList,int listenerBRId, ActionViewListener listener, StickyListGroup stickyListGroup) {
        recyclerVo= new RecyclerVo(clubList,R.layout.list_club_item, BR.club,listenerBRId,listener);
        recyclerVo.stickyListGroup.set(stickyListGroup);
        vo.clubList.set(recyclerVo);
    }

    protected void notifyItems(){
        recyclerVo.items.notifyChange();
    }

    protected void  setClubItems(ObservableList clubItems){
        recyclerVo.items.set(clubItems);
    }


}
